/**
 * @(#)TaskInstanceCommentListTag.java Jan 20, 2010
 *   
 * Copyright  (c) 2009-2010 Wilmar IT Service,  Inc.   
 * All  rights  reserved.   
 * TODO
 */

package com.wilmar.process.web.taglibs;

import java.util.List;

import org.jbpm.api.history.HistoryDetail;

import com.wilmar.process.core.services.api.ISystemHistoryTaskInstanceService;
import com.wilmar.process.enumerate.EnumProcessBeanIdSet;
import com.wilmar.process.enumerate.EnumProcessSystemTagFixedVariableNameSet;

/**
 * @author MaKuBEX Email:makubexnet@gmail.com
 * @version 1.0.0
 */
public class TaskInstanceCommentListTag extends ProcessTagSupport {

	/**
	 * @serialField
	 */
	private static final long serialVersionUID = -5970816128411002653L;

	private String width;
	private String cellpadding;
	private String cellspacing;
	private String border;

	/**
	 * @see org.springframework.web.servlet.tags.RequestContextAwareTag#doStartTagInternal()
	 */
	protected int doStartTagInternal() throws Exception {
		ISystemHistoryTaskInstanceService systemHistoryTaskInstanceService = (ISystemHistoryTaskInstanceService) super
				.getBean(EnumProcessBeanIdSet.PROCESS_SYSTEM_HISTORY_TASKINSTANCE_SERVICE);
		List<HistoryDetail> commentList = systemHistoryTaskInstanceService
				.getCommentList(super
						.getAttribute(EnumProcessSystemTagFixedVariableNameSet.PROCESS_INFORMATION_TASK_INSTANCE_ID));
//		StringBuffer html = new StringBuffer();
		for (HistoryDetail detail : commentList) {
			detail.getUserId();
		}
		return 0;
	}

	/**
	 * @return the width
	 */
	public String getWidth() {
		return width;
	}

	/**
	 * @param width the width to set
	 */
	public void setWidth(String width) {
		this.width = width;
	}

	/**
	 * @return the cellpadding
	 */
	public String getCellpadding() {
		return cellpadding;
	}

	/**
	 * @param cellpadding the cellpadding to set
	 */
	public void setCellpadding(String cellpadding) {
		this.cellpadding = cellpadding;
	}

	/**
	 * @return the cellspacing
	 */
	public String getCellspacing() {
		return cellspacing;
	}

	/**
	 * @param cellspacing the cellspacing to set
	 */
	public void setCellspacing(String cellspacing) {
		this.cellspacing = cellspacing;
	}

	/**
	 * @return the border
	 */
	public String getBorder() {
		return border;
	}

	/**
	 * @param border the border to set
	 */
	public void setBorder(String border) {
		this.border = border;
	}
}
